//
// Created by wze-zero on 2024/9/16 016.
//
#include <iostream>

using namespace std;

int main() {
    int num;
    cin >> num;
    for (int i = 1; i < num * 3 + 1; ++i) {
        for (int j = num * 3 - i; j > 0; --j) {
            cout << " ";
        }
        for (int j = 1; j < i + 1; ++j) {
            if (i % 3 == 0) {
                cout << "* ";
            } else if (i % 3 == 1) {
                for (int k = 0; k < i / 3 + 1; ++k) {
                    cout << "*     ";
                }
                break;
            } else if (i % 3 == 2) {
                for (int k = 0; k < i / 3 + 1; ++k) {
                    cout << "* *   ";
                }
                break;
            }
        }
        cout << endl;
    }
    for (int i = 0; i < num; ++i) {
        for (int j = 0; j < 3 * num - 1; ++j) {
            cout << " ";
        }
        cout << "*" << endl;
    }
    return 0;
}